﻿<%@ Page Language="C#" MasterPageFile="~/Site.master" CodeBehind="Insert.aspx.cs" Inherits="Mani.Common.UI.Insert" %>

<asp:Content ID="headContent" ContentPlaceHolderID="HeadContent" Runat="Server">
</asp:Content>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" Runat="Server">

    <h3 class="ui-widget-header">
            ایجاد   
            <%= table.DisplayName%>
             جدید
    </h3>

    <div class="ui-layout-content ui-widget-content">
        <asp:DynamicDataManager ID="DynamicDataManager1" runat="server" AutoLoadForeignKeys="true">
            <DataControls>
                <asp:DataControlReference ControlID="FormView1" />
            </DataControls>
        </asp:DynamicDataManager>

        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:ValidationSummary ID="ValidationSummary1" runat="server" EnableClientScript="true"
                    HeaderText="لیست خطاها :" CssClass="DDValidator" />
                <asp:DynamicValidator runat="server" ID="DetailsViewValidator" ControlToValidate="FormView1" Display="None" CssClass="DDValidator" />

                <asp:FormView runat="server" ID="FormView1" DataSourceID="DetailsDataSource" DefaultMode="Insert"
                    OnItemCommand="FormView1_ItemCommand" OnItemInserted="FormView1_ItemInserted" RenderOuterTable="false">
                    <InsertItemTemplate>
                        <table id="detailsTable" class="DDDetailsTable" cellpadding="6">
                            <asp:DynamicEntity runat="server" Mode="Insert" />
                            <tr class="td">
                                <td colspan="2">
                                    <asp:LinkButton runat="server" CommandName="Insert" Text="ایجاد آیتم جدید" />
                                    <asp:LinkButton runat="server" CommandName="Cancel" Text="انصراف" CausesValidation="false" />
                                </td>
                            </tr>
                        </table>
                    </InsertItemTemplate>
                </asp:FormView>

                <asp:EntityDataSource ID="DetailsDataSource" runat="server" EnableInsert="true" />
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
</asp:Content>

